package ZUOYE2;
public class test {
    public static void main(String[] args){
        //产生随机数
        int num=(int)(Math.random()*3);
        Pet pet=null;
        if(num==1){
            pet=new Cat();
            pet.Speak();
        }else if(num==2){
            pet=new Dog ();
            pet.Speak();
        }else{
            pet=new Yang();
            pet.Speak();
        }
    }
}
